/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Grnmnd
 */
@Entity
@Table(name = "membresiaasignada")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Membresiaasignada.findAll", query = "SELECT m FROM Membresiaasignada m"),
    @NamedQuery(name = "Membresiaasignada.findById", query = "SELECT m FROM Membresiaasignada m WHERE m.id = :id"),
    @NamedQuery(name = "Membresiaasignada.findByIdUsuario", query = "SELECT m FROM Membresiaasignada m WHERE m.idUsuario = :idUsuario"),
    @NamedQuery(name = "Membresiaasignada.findByAutorizo", query = "SELECT m FROM Membresiaasignada m WHERE m.autorizo = :autorizo"),
    @NamedQuery(name = "Membresiaasignada.findByInicio", query = "SELECT m FROM Membresiaasignada m WHERE m.inicio = :inicio"),
    @NamedQuery(name = "Membresiaasignada.findByFin", query = "SELECT m FROM Membresiaasignada m WHERE m.fin = :fin"),
    @NamedQuery(name = "Membresiaasignada.findByLiquidada", query = "SELECT m FROM Membresiaasignada m WHERE m.liquidada = :liquidada"),
    @NamedQuery(name = "Membresiaasignada.findByAbono", query = "SELECT m FROM Membresiaasignada m WHERE m.abono = :abono")})
public class Membresiaasignada implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "id_usuario")
    private int idUsuario;
    @Basic(optional = false)
    @Column(name = "autorizo")
    private int autorizo;
    @Basic(optional = false)
    @Column(name = "inicio")
    @Temporal(TemporalType.TIMESTAMP)
    private Date inicio;
    @Basic(optional = false)
    @Column(name = "fin")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fin;
    @Basic(optional = false)
    @Column(name = "liquidada")
    private boolean liquidada;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "abono")
    private BigDecimal abono;
    @JoinColumn(name = "id_membresia", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Membresia idMembresia;

    public Membresiaasignada() {
    }

    public Membresiaasignada(Integer id) {
        this.id = id;
    }

    public Membresiaasignada(Integer id, int idUsuario, int autorizo, Date inicio, Date fin, boolean liquidada, BigDecimal abono) {
        this.id = id;
        this.idUsuario = idUsuario;
        this.autorizo = autorizo;
        this.inicio = inicio;
        this.fin = fin;
        this.liquidada = liquidada;
        this.abono = abono;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(int idUsuario) {
        this.idUsuario = idUsuario;
    }

    public int getAutorizo() {
        return autorizo;
    }

    public void setAutorizo(int autorizo) {
        this.autorizo = autorizo;
    }

    public Date getInicio() {
        return inicio;
    }

    public void setInicio(Date inicio) {
        this.inicio = inicio;
    }

    public Date getFin() {
        return fin;
    }

    public void setFin(Date fin) {
        this.fin = fin;
    }

    public boolean getLiquidada() {
        return liquidada;
    }

    public void setLiquidada(boolean liquidada) {
        this.liquidada = liquidada;
    }

    public BigDecimal getAbono() {
        return abono;
    }

    public void setAbono(BigDecimal abono) {
        this.abono = abono;
    }

    public Membresia getIdMembresia() {
        return idMembresia;
    }

    public void setIdMembresia(Membresia idMembresia) {
        this.idMembresia = idMembresia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Membresiaasignada)) {
            return false;
        }
        Membresiaasignada other = (Membresiaasignada) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelo.Membresiaasignada[ id=" + id + " ]";
    }
    
}
